/*
 * System.h
 *
 *  Created on: 2022��3��11��
 *      Author: TangJie
 */

#ifndef SYSTEM_SYSTEM_H_
#define SYSTEM_SYSTEM_H_

#include "SysCommon.h"
#include "MCU.h"

#define SESSION_DEFAULT    1
#define SESSION_PROGRAM    2
#define SESSION_EXTEND     3

#define SERVICE_SECURITY_ACCESS    0x27

#define LIN_READ_SW_VERSION    0x21 //33
extern const uint8_t g_u8SoftwareVersion[2];

typedef struct
{
	uint8_t infoDataLen;             /*Exchange inforamtion length must N * 4.*/
	uint8_t requestEnterBootloader;  /*Request enter bootloader mode flag*/
	uint8_t downloadAPPSuccessful;   /*downlaod APP successful flag*/
	uint32_t infoStartAddr;          /*exchange information start address*/
	uint32_t requestEnterBootloaderAddr; /*Request enter bootloader flag address */
	uint32_t downloadAppSuccessfulAddr;  /*download APP successful flag address*/
}tBootInfo;

typedef void(*LinTxCompletedCallback)(void);
typedef struct
{
	//l_u8 u8LastPID;
	LinTxCompletedCallback TxCallback;
}LinTxCompletedPara_t;


#define DOWNLOAD_REQUEST_FLAG_ADD  0x200037F0u
#define DOWNLOAD_REQUEST_FLAG      0x5AA5DAADu

extern void LinDiag_MainFunction(void);

extern void Sys_ClearRAMProgramFlag(void);

//extern l_u8 ld_read_by_id_callout(l_ifc_handle iii, l_u8 id, l_u8 *data);

#endif /* SYSTEM_SYSTEM_H_ */
